$def with(projs, pager, query_key = '')
$:render.admin.header(css=['admin/css/popup.css', 'admin/css/media.css'])

<script type="text/javascript">
    var topWin = window.dialogArguments || opener || parent || top;
    $$(function() {
        $$('.describe-toggle-on').click(function() {
            var self = $$(this);
            var id = self.attr('proj');
            var type = self.attr('proj_type')
            topWin.proj_selected(id, self.parent().find('.title').html(), type);
        });
    });
</script>
<div id="media-upload-header">
	<ul id="sidemenu">
		<li id="tab-type"><a href="javascript:;" onclick="alert('尚未实现！');return false;">添加</a></li>
        <!--<li id="tab-type_url"><a href="javascript:;">从 URL</a></li>-->
		<li id="tab-library"><a href="$config.ADMIN_DIR/proj?mode=lite" class="current">项目库</a></li>
	</ul>
</div>

<form id="filter" action="" method="get">
<div class="tablenav">

    <div class='tablenav-pages'>
        $:pager
    </div>
<div class="alignleft actions">
<label class="screen-reader-text" for="media-search-input">搜索项目:</label>
	<input type="text" class="txt" id="media-search-input" name="q" value="$query_key" />
    <input type="hidden" name="mode" value="lite" />
    <input type="submit" class="btn" value="搜索项目"  />
</div>

<br class="clear" />
</div>
</form>


<div id="media-items">
    $if projs:
        $for proj in projs:
            <div id="media-item-$proj.id" class="media-item child-of-0 preloaded">
                <a class="toggle describe-toggle-on" href="javascript:;" proj="$proj.id" proj_type="$proj.type">选择</a>
                <div class="filename new"><span class="title">$proj.name</span></div>
            </div>
    $else:
        <font color="gray">尚未添加项目</font>
</div>


$:render.admin.footer()
